package com.csht.service.Impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.csht.mapper.CshtTenGoodsEverydayMapper;
import com.csht.service.CshtTenGoodsEverydayService;
import com.csht.vo.index.tenGoods.CshtTenGoodsEverydayVo;

/**
 * 
 * 每日十条商品
 * @author Administrator
 *
 */
@Service
public class CshtTenGoodsEverydayServiceImpl implements CshtTenGoodsEverydayService{
	
	@Autowired
	private CshtTenGoodsEverydayMapper cshtTenGoodsEverydayMapper;

	/**
	 * 获取每日十条商品的包装类
	 */
	@Override
	public List<CshtTenGoodsEverydayVo> getTenGoodsEveryday() throws Exception {
		List<CshtTenGoodsEverydayVo> cshtTenGoodsEverydayVocshtList = cshtTenGoodsEverydayMapper.getTenGoodsEveryday();
		return cshtTenGoodsEverydayVocshtList;
	}

	/**
	 * 每天更新每日十件商品时先清空表
	 */
	@Override
	public void truncateTable() throws Exception {
		cshtTenGoodsEverydayMapper.truncateTable();
	}

	/**
	 * 每天更新十条商品到每日十件表中
	 */
	@Override
	public void updateTenGoodsEveryday(List<Integer> tenGoodsIdList) throws Exception {
		cshtTenGoodsEverydayMapper.updateTenGoodsEveryday(tenGoodsIdList);
	}

}
